home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
wtek0693.zip
/
OOPALLEY.ZIP
/
LOOKUPKE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-27
|
979b
|
46 lines
#include "lookupke.h"
#define THIS LookupKey
#define BASE Object
DEFINE_CLASS(LookupKey,Object);
LookupKey::LookupKey(const Object& newKey)
{
akey = (Object*)&newKey;
}
Object* LookupKey::key() const { return akey; }
Object* LookupKey::key(const Object& newkey)
{
Object* temp = akey;
akey = (Object*)&newkey;
return temp;
}
bool LookupKey::isEqual(const Object& ob) const { return ob.isEqual(*akey); }
unsigned LookupKey::hash() const { return akey->hash(); }
int LookupKey::compare(const Object& ob) const { return ob.compare(*akey); }
void LookupKey::deepenShallowCopy()
{
akey = akey->deepCopy();
}
void LookupKey::printOn(ostream& strm) const
{
akey->printOn(strm);
}
Object* LookupKey::value() const
{
derivedClassResponsibility("value"); return (Object*)0;
}
Object* LookupKey::value(const Object& newvalue)
{
derivedClassResponsibility("value"); return (Object*)&newvalue;
}